package com.subject.shuati.application.controller;

import com.subject.shuati.common.entity.PageResult;
import com.subject.shuati.infra.basic.entity.SubjectInfoEs;
import com.subject.shuati.infra.basic.service.SubjectEsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/subject/es")
@Slf4j
public class TestController {
    @Resource
    private SubjectEsService subjectEsService;
//    @Resource
//    private SubjectEsService subjectEsService;
//
//    @GetMapping("/createIndex")
//    public void createIndex() {
//        subjectEsService.createIndex();
//    }
    @PostMapping("/SearchKeyword")
    public void addDocs() {
        SubjectInfoEs subjectInfoEs = new SubjectInfoEs();
        subjectInfoEs.setKeyWord("MySql");
        PageResult<SubjectInfoEs> subjectInfoEsPageResult = subjectEsService.searchSubjectInfoList(subjectInfoEs);
        log.info("subjectInfoEsPageResult:{}",subjectInfoEsPageResult);
    }
}
